Polynomial Generators have MCA for RSCodes - #610
Conversation
🤖 PR Summary
The PR formalizes the MCA property for polynomial generators over Reed–Solomon codes, primarily proving Theorem 9.2 of [BCGM25] conditionally on two sorried lemmas. It also reorganizes the proximity generator module hierarchy and adds several supporting definitions and lemmas. Statistics
Lean Declarations ✏️ Removed: 7 declaration(s)
✏️ Added: 46 declaration(s)
✏️ Affected: 3 declaration(s) (line number changed)
❌ Added: 3 `sorry`(s)
📋 **Additional Analysis**The diff restructures the directory 📄 **Per-File Summaries**
Last updated: 2026-07-21 15:55 UTC. |
🤖 AI ReviewOverall Summary: Errors during review:
🔍 **Mechanical Pre-Check Results**Escape hatches introduced in this PR (triggers hard verdict rule):
Pre-existing escape hatches in touched files (context only, does not affect verdict):
🔗 **Cross-File Analysis**Cross-file analysis failed: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'API key not valid. Please pass a valid API key.', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'API_KEY_INVALID', 'domain': 'googleapis.com', 'metadata': {'service': 'generativelanguage.googleapis.com'}}, {'@type': 'type.googleapis.com/google.rpc.LocalizedMessage', 'locale': 'en-US', 'message': 'API key not valid. Please pass a valid API key.'}]}} 📄 **Review for `ArkLib.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/CodingTheory/Basic/LinearCode.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/CodingTheory/Prelims.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/CodingTheory/ProximityGenerator/AffineGenerator.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/CodingTheory/ProximityGenerator/Basic.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/CodingTheory/ProximityGenerator/MCAGenerator.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/CodingTheory/ProximityGenerator/PolynomialGenerator.lean`**An error occurred while analyzing 📄 **Review for `ArkLib/Data/Probability/Instances.lean`**An error occurred while analyzing |
🤖 PR Summary
This pull request formalizes the MCA (Mutual Correlated Agreement) error analysis for polynomial generators, establishing Theorems 8.2 and 9.2 from [BCGM25] (MDS codes and Reed–Solomon codes). It also reorganizes the proximity generator module hierarchy from a flat Mathematical Formalization
Refactoring / Infrastructure
No other sorries or admits are present anywhere in the changed files. Statistics
Lean Declarations ✏️ Removed: 7 declaration(s)
✏️ Added: 57 declaration(s)
✏️ Affected: 3 declaration(s) (line number changed)
❌ Added: 3 `sorry`(s)
📋 **Additional Analysis**The diff contains a substantial refactor that renames the directory 📄 **Per-File Summaries**
Last updated: 2026-07-27 11:24 UTC. |
|
|
||
| /-- The restricted univariate powers generator is an MDS generator (its code is Reed–Solomon, | ||
| hence MDS). -/ | ||
| lemma UnivariatePowersOn.isMDSGenerator [DecidableEq F] (s : Set F) [Fintype s] [Nonempty s] |
There was a problem hiding this comment.
quick note that ismDS will require [Inhabited ι] now that #663 has merged, which will allow you to remove (h : d + 1 ≤ Fintype.card ↥s)
| · have hℓ : 2 ≤ Fintype.card (Fin (d + 1)) := by rw [Fintype.card_fin]; omega | ||
| have hdim : LinearCode.dim (fromColGenMat (M_G (UnivariatePowersOn s d))) | ||
| = Fintype.card (Fin (d + 1)) := by | ||
| rw [UnivariatePowersOn.code_eq_reedSolomon, ReedSolomon.dim_eq_deg_of_le' h, Fintype.card_fin] |
There was a problem hiding this comment.
also a note that ReedSolomon.dim_eq_deg_of_le' can be replaced by ReedSolomon.dim_eq_deg_of_le now.
|
|
||
|
|
||
| /-- Definition 9.1 MCA error function for Reed-Solomon codes [BCGM25]. -/ | ||
| noncomputable def ε_mca_RS [Fintype F] (n d m : ℕ) : I → ℝ := |
There was a problem hiding this comment.
n is the block length so it should be constrained to be Fintype.card ι (line 47 above exemplifies this).
Same in other statements below.
| let ρ_sqrt := ReedSolomon.sqrtRate k D | ||
| fun γ => | ||
| if γ ≤ 1 - (1 + (1 / (2 * m : ℝ))) * ρ_sqrt then | ||
| (|Fintype.card F| : ℝ)⁻¹ * (m + 1 / 2) ^ 7 * (3 * (ρ_sqrt) ^ 3)⁻¹.toReal * d * n ^ 2 |
There was a problem hiding this comment.
careful with this because ρ_sqrt := ReedSolomon.sqrtRate is R >= 0, and lean will allow division by 0 which is implicitely gaurded against in the paper definition. k > 0 should prevent this?
| let ρ_sqrt := ReedSolomon.sqrtRate k D | ||
| fun γ => | ||
| if γ ≤ 1 - (1 + (1 / (2 * m : ℝ))) * ρ_sqrt then | ||
| (|Fintype.card F| : ℝ)⁻¹ * (m + 1 / 2) ^ 7 * (3 * (ρ_sqrt) ^ 3)⁻¹.toReal * d * n ^ 2 |
There was a problem hiding this comment.
|Fintype.card F| can just be Fintype.card F
| def projectedWord [Fintype ι] (c : ι → F) (T : Finset ι) : T → F := Set.restrict T c | ||
|
|
||
| /-- Let `C` be a code of length `ι`. For every finite `ι`-subset `T`, we define the projected code | ||
| `C|[T]` as the set of projected codewords `c|[T]`, for `c ∈ C`. |
There was a problem hiding this comment.
minor docstring change after the notation change in #596
| /-- A function assinging the maximum degree in the `i`-the variable of the collection of | ||
| polynomials `P`. -/ | ||
| noncomputable def deg_max {s : ℕ} {ℓ : Type} [Fintype ℓ] (P : ℓ → MvPolynomial (Fin s) F) : | ||
| Fin s → ℕ := fun i => Finset.sup Fintype.elems (fun j => (P j).degreeOf i) |
There was a problem hiding this comment.
finset.uni is seemingly more popular/standard than .elems. I don't really know if it's a big deal, but it keeps the definition in terms of finset only.
| apply ENNReal.tsum_le_tsum | ||
| intro r | ||
| rw [← mul_add] | ||
| refine mul_le_mul_of_nonneg_left ?_ zero_le' |
There was a problem hiding this comment.
linter says use zero_le
| _ ≤ ∑' b, Db b * c := by | ||
| apply ENNReal.tsum_le_tsum | ||
| intro b | ||
| exact mul_le_mul_of_nonneg_left (h b) zero_le' |
There was a problem hiding this comment.
linter says use zero_le
| The affine line generator `F → F²`, `x ↦ (1, x)`, having MCA error `ε_mca` for `LC` implies that | ||
| the affine space generator `Fˡ → Fˡ⁺¹`, `x ↦ (1, x)`, has MCA for `LC` with error | ||
| `(1 - 1/|F|)⁻¹ • ε_mca`. -/ | ||
| theorem AffineLine_MCA_AffineSpaceMCA {ℓ : ℕ} (hℓ : ℓ ≥ 2) (ε_mca : I → ℝ) (LC : LinearCode ι F) |
There was a problem hiding this comment.
worth merging in main to get rid of ε_mca : I → ℝ now that #596 is merged
This PR formalises
MCA error function for MDS codes (appears in the statement of Theorem 6.1 [BCGM25]).
Statement of
Theorem 6.1(MCA for MDS generators) [BCGM25].Definition 8.1 (MCA error for univariate powers)[BCGM25].Theorem 8.2(polynomial_gen_MCA) [BCGM25] (statement and proof).Definition 9.1[BCGM25].Statement of
Lemma 9.3(univariate_powers_MCA) [BCGM25].Theorem 9.2(polynomial_gen_MCA_RScode) [BCGM25] (statement and proof assumingLemma 9.3).Interesting outcomes:
tensor_of_univ_is_MCAthat is assumed in the proof ofTheorem 9.2.In fact, we prove a more general version of this result. In the paper, the result is stated only for a Reed-Solomon code. We prove this for a univariate generator of any code!Athat appears in the proof ofTheorem 9.2.